#include <iostream>
#include <iomanip>
#include <fstream>
#include "bookOrder.h"

using namespace std;

int main(int argc, char** argv) {
	OrderManager* pOM = new OrderManager();

	printf("\33[32m [MARCO][%d]---ORDER NUM [%d]---\33[0m\n", __LINE__, pOM->getOrderNum()); 

	for (int i = 0; i < 10; ++i) {
		char cName[2] = { 0 };
		cName[0] = i + 65;
		cName[1] = '\0';
		int r = rand();
		pOM->addOrder(r, cName);
		pOM->addOrder(r, cName);
	}

	pOM->priOrders();
	pOM->saveToDB("./1.txt");

	pOM->sortOrders();
	printf("\33[33m [MARCO][%d]------\33[0m\n", __LINE__); 
	pOM->priOrders();
	pOM->saveToDB("./2.txt");
	printf("\33[33m [MARCO][%d]------\33[0m\n", __LINE__); 
	pOM->uniqueOrders();
	pOM->priOrders();
	pOM->saveToDB("./3.txt");

	printf("\33[32m [MARCO][%d]---ORDER NUM [%d]---\33[0m\n", __LINE__, pOM->getOrderNum()); 
	delete pOM;
}
